define(function(require, exports, module) {
	"require:nomunge,exports:nomunge,module:nomunge";

	var app = require('mokit/app');
	var AskListView = require('../views/ask-info');
	var commonUtils = require('../common/utils');
	var Ask = require('../models/Ask');
	var Share = require("../models/Share");

	/**
	 * 社友录页面控制器
	 */
	return app.controller.create({
		isSetting: true,
		/**
		 * 默认action
		 */
		index: function(context) {
			var self = this;
			Ask.getInfo(context.routeData.id, function() {
				self.setView(new AskListView({
					model: Ask
				}));
			});
		},
		
		sayGood: function(context){
			Share.sayGood(1, Ask.id, function(){
				alert("已赞");
				context.view.toggleMenu();
			});
		},
		
		add2fav: function(context){
			Share.add2fav(2, Ask.id, function(){
				alert("已收藏");
				context.view.toggleMenu();
			});
		},		
		
		share: function(context){
			Share.share(0,0,function(){
				alert("已分享");
				context.view.toggleMenu();
			});
		},
	});

});